import 'package:cherry_toast/cherry_toast.dart';
import 'package:cherry_toast/resources/arrays.dart';
import 'package:decorated_flutter/src/utils/utils.export.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

void toast(
  String? message, {
  double radius = 16,
  @Deprecated('已无作用') EdgeInsets? padding,
  TextStyle textStyle = const TextStyle(color: Colors.black),
  VoidCallback? onDismiss,
  @Deprecated('已无作用') bool dismissOtherToast = true,
  @Deprecated('已无作用') TextAlign textAlign = TextAlign.center,
  Duration duration = const Duration(seconds: 2),
  Color backgroundColor = Colors.white,
  bool error = false,
}) {
  if (isNotEmpty(message)) {
     Fluttertoast.showToast(
        msg: message!,
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.CENTER,
        timeInSecForIosWeb: 1,
        backgroundColor: Colors.black54,
        textColor: Colors.white,
        fontSize: 16.0
    );
  } else {
    L.w('[DECORATED_FLUTTER] toast传入null值, 略过');
  }
}
